home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / v cisle / autoit / autoit-v3.2.0.1-setup.exe / Examples / Helpfile / TrayItemSetState.au3 < prev    next >
Text File  |  2006-06-17  |  522b  |  27 lines

  1. #Include <Constants.au3>
  2. #NoTrayIcon
  3.  
  4. Opt("TrayMenuMode",1)    ; Default tray menu items (Script Paused/Exit) will not be shown.
  5.  
  6. $chkitem        = TrayCreateItem("Check it")
  7. TrayCreateItem("")
  8. $checkeditem    = TrayCreateItem("Checked")
  9. TrayCreateItem("")
  10. $exititem        = TrayCreateItem("Exit")
  11.  
  12. TraySetState()
  13.  
  14. While 1
  15.     $msg = TrayGetMsg()
  16.     Select
  17.         Case $msg = 0
  18.             ContinueLoop
  19.         Case $msg = $chkitem
  20.             TrayItemSetState($checkeditem,$TRAY_CHECKED)
  21.         Case $msg = $exititem
  22.             ExitLoop
  23.     EndSelect
  24. WEnd
  25.  
  26. Exit
  27.